<?php

namespace app\dao\office;

use app\dao\BaseDao;
use app\model\office\OfficeFeedback;

class OfficeFeedbackDao extends BaseDao
{

    public function index(array $where)
    {
        return $this ->search()
            ->with(['users' => function ($query){
                $query -> withField(['id','name','phone']);
            }])
            -> where('website_id',$where['website_id']) ->paginate($where['pageSize']);
    }

    public function deleteDao(array $where)
    {
        return $this->getModel()->whereIn('id', $where['id'])->update(['delete_time' => date('Y-m-d H:i:s', time())]);
    }

    protected function setModel(): string
    {
        return OfficeFeedback::class;
    }
}